
/**
 * Project Name:cats-core
 * File Name:GeneralService.java
 * Package Name:com.catsic.core.general.service
 * Date:2014-3-5上午9:54:24
 * Copyright (c) 2014, oa.catsic.com All Rights Reserved.
 */
 
package com.catsic.core.general.service;

/**
 * ClassName: GeneralService
 * Description: TODO 实现通用模块的标准增产改查
 * date: 2014-3-5 上午9:54:24
 * author: Jay
 */

 
public interface GeneralService {
	
	
	 /**
	 * getSearchFrame:页面搜索部分无格式HTML.
	 * @author Jay
	 * @param entityname
	 * @return
	 */
	 
	String getSearchFrame( String entityname );
	
	//String getListFrame( String entityname );
	
	 /**
	 * getListFrame:获得列表HTML.
	 * @author Jay
	 * @param entityname
	 * @return
	 */	

	String getListFrame(String entityname);
	
	 /**
	 * getAddFrame:增加页面无格式HTML.
	 * @author Jay
	 * @param entityname
	 * @param id
	 * @return
	 */
	 
	String getAddFrame( String entityname, Long id );
	
	
	 /**
	 * getEditFrame:编辑页面无格式HTML.
	 * @author Jay
	 * @param entityname
	 * @param id
	 * @return
	 */
	 
	String getEditFrame( String entityname, Long id );
	
	
	 /**
	 * getViewFrame:删除页面无格式HTML.
	 * @author Jay
	 * @param entityname
	 * @param id
	 * @return
	 */
	 
	String getViewFrame( String entityname, Long id );
	
	 /**
	 * add:创建实体
	 * @author Jay
	 * @param entity
	 * @return
	 */
	int add( String entityname, Object entity );

	 /**
	 * delete:根据主键删除实体
	 * @author jay
	 * @param id
	 */
	void delete( String entityname,Long id );
	
	 /**
	 * delete:删除实体
	 * @author Jay
	 * @param entity
	 */
	//void delete( String entityname, Object entity );

	/**
	 * delete:删除实体集合，如List、Set
	 * @author Jay
	 * @param entities
	 */
	//void delete(Iterable< Object > entities);
	
	 /**
	 * update:更新实体
	 * @author Jay
	 * @param entity
	 */
	void update( String entityname, Object entity );
	
	
	 /**
	 * getById:根据主键获得实体
	 * @author jay
	 * @param id
	 * @return
	 */
	//Object getById(Long id);

	
	 /**
	 * exists:根据ID查看实体类是否存在，true 存在、false 不存在
	 * @author Jay
	 * @param id
	 * @return
	 */
	//boolean exists(Long id);

	
	 /**
	 * findAll:返回所有实体
	 * @author Jay
	 * @return
	 */
	//List<Object> findAll();

	
	 /**
	 * findAll:根据给定的ID集合，返回实体List集合
	 * @author jay
	 * @param ids
	 * @return
	 */
	//List<Object> findAll(Iterable<Long> ids);

	
	 /**
	 * save:保存单实体
	 * @author yangyd
	 * @param entities
	 * @return
	 */
	int save(String entityname, Object entities);

}
